<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>无标题文档</title>
<link href="${pageContext.request.contextPath}/css/baStyle.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/baPublicJs.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.shCircleLoader.js" type="text/javascript"></script>
</head>


<style type="text/css">
#keyword {
    border: 3px solid #cccccc;
    color: #999999;
    height: 30px;
    line-height: 30px;
    padding-left:5px;
    width:100px;
}
.box div[id] {
	width: 100px;
	height: 100px;
	margin: 10px auto;
}

.box {
	position: absolute;
	width: 600px;
	left: 50%;
	height: auto;
	z-index: 100;
	padding: 1px;
}

#bg {
	background-color: #666;
	position: absolute;
	z-index: 99;
	left: 0;
	top: 0;
	display: none;
	width: 100%;
	height: 100%;
	opacity: 0.5;
	filter: alpha(opacity = 50);
	-moz-opacity: 0.5;
}
</style>
<script type="text/javascript">

function alterYear(){
	var year=$("#keyword").val();
	str = year.substring(0,year.indexOf(":"));
	if("当前年份"!=str){
		var id=$("#hiddenId").val();
		$.ajax({
			type:"post", //提交的类型
			url:"${pageContext.request.contextPath}/baSkip/newYear.do",//提交地址
		    dataType: 'text',
		    data: {
			    "year":year,
			    "id":id
			   },
			success: function(data){
				if("1"==data){
					alert("修改成功");
					location="${pageContext.request.contextPath}/baSkip/alterYear.do";//刷新
				}else{
					alert("修改失败");
				}
			   
			} 
		});
	}else{
		alert("请填写您要修改的年份!");
	}
}


function backupsDate(){
	//调用遮罩层
 	shade();
	$.ajax({
		type:"post", //提交的类型
		url:"${pageContext.request.contextPath}/baSkip/backupsDate.do",//提交地址
	    dataType: 'text',
		success: function(data){
			//点击关闭按钮的时候，遮罩层关闭
			$("#bg,.box").css("display", "none");
			if("succeed"==data){
				alert("数据备份成功！");
			}else if("erro"==data){
				alert("数据备份失败！");
			}
		} 
	});
}

</script>
<body>

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">数据配置</a></li>
    <li><a href="#">年份修改及数据备份</a></li>
    </ul>
    </div>
    
   <div class="formbody">
    <div class="formtitle"><span>年份修改</span></div>
		<ul class="forminfo" style="padding-left: 50px;">
			<li class="selectScan">
			<span style="font-size: 20px;font-weight: bold;float:left;padding-right: 10px;">修改年份 </span>
			<input id="hiddenId"  name="id" type="hidden" value="${newYear.id}"/>
			<input id="keyword" type="text"
				value="当前年份:${newYear.variableval}"
				onfocus="if (this.value==this.defaultValue){this.value='';this.style.color='#333'}"
				onkeyup="$('#tie').show()"
				onblur="if (this.value==''){this.value=this.defaultValue;this.style.color='#999'}"
				onkeydown="javascript:if(event.keyCode==13) search('key');"
				name="keyword" />
			</li>
			<li><input name="" type="button" class="btn" value="确定修改"
				onclick="alterYear();" style="margin-top: 50px;" /></li>
		</ul>
	</div>
	
	
    <div class="formbody">
        <div class="formtitle"><span>数据备份</span></div>
		<ul class="forminfo" style="padding-left: 50px;">
			<li><input name="" type="button" class="btn" value="开始备份"
				onclick="backupsDate();" style="margin-top: 50px;" /></li>
		</ul>

	</div>
    <!--遮罩和加载  -->
		<div id="bg"></div>
		<div class="box" style="display:none">
		   <div id="shclDefault"></div>
		</div>

</body>

</html>

